<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Qwt User&#39;s Guide: QwtBezier Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Qwt User&#39;s Guide
   &#160;<span id="projectnumber">6.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_qwt_bezier.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_qwt_bezier-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QwtBezier Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>An implementation of the de Casteljau’s Algorithm for interpolating Bézier curves.  
 <a href="class_qwt_bezier.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="qwt__bezier_8h_source.html">qwt_bezier.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7b74d8e4874bc39110c84f74594d61b9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_bezier.html#a7b74d8e4874bc39110c84f74594d61b9">QwtBezier</a> (double <a class="el" href="class_qwt_bezier.html#a53b980b7397ef4bdcbc011d6556108b8">tolerance</a>=0.5)</td></tr>
<tr class="memdesc:a7b74d8e4874bc39110c84f74594d61b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="class_qwt_bezier.html#a7b74d8e4874bc39110c84f74594d61b9">More...</a><br /></td></tr>
<tr class="separator:a7b74d8e4874bc39110c84f74594d61b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a750ad26d6b7a3c37685f03db98868d3f"><td class="memItemLeft" align="right" valign="top"><a id="a750ad26d6b7a3c37685f03db98868d3f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_bezier.html#a750ad26d6b7a3c37685f03db98868d3f">~QwtBezier</a> ()</td></tr>
<tr class="memdesc:a750ad26d6b7a3c37685f03db98868d3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a750ad26d6b7a3c37685f03db98868d3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c0ad844ea7d4ee69f3c391fd1a93ae7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_bezier.html#a5c0ad844ea7d4ee69f3c391fd1a93ae7">setTolerance</a> (double <a class="el" href="class_qwt_bezier.html#a53b980b7397ef4bdcbc011d6556108b8">tolerance</a>)</td></tr>
<tr class="separator:a5c0ad844ea7d4ee69f3c391fd1a93ae7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53b980b7397ef4bdcbc011d6556108b8"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_bezier.html#a53b980b7397ef4bdcbc011d6556108b8">tolerance</a> () const</td></tr>
<tr class="separator:a53b980b7397ef4bdcbc011d6556108b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cac7efebcc8bf42fe9a12552a9d727d"><td class="memItemLeft" align="right" valign="top">QPolygonF&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_bezier.html#a1cac7efebcc8bf42fe9a12552a9d727d">toPolygon</a> (const QPointF &amp;p1, const QPointF &amp;cp1, const QPointF &amp;cp2, const QPointF &amp;p2) const</td></tr>
<tr class="memdesc:a1cac7efebcc8bf42fe9a12552a9d727d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interpolate a Bézier curve by a polygon.  <a href="class_qwt_bezier.html#a1cac7efebcc8bf42fe9a12552a9d727d">More...</a><br /></td></tr>
<tr class="separator:a1cac7efebcc8bf42fe9a12552a9d727d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e67390b7109a819d29b043418bcb1b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_bezier.html#a1e67390b7109a819d29b043418bcb1b5">appendToPolygon</a> (const QPointF &amp;p1, const QPointF &amp;cp1, const QPointF &amp;cp2, const QPointF &amp;p2, QPolygonF &amp;polygon) const</td></tr>
<tr class="memdesc:a1e67390b7109a819d29b043418bcb1b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interpolate a Bézier curve by a polygon.  <a href="class_qwt_bezier.html#a1e67390b7109a819d29b043418bcb1b5">More...</a><br /></td></tr>
<tr class="separator:a1e67390b7109a819d29b043418bcb1b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a962c356b89fb7fd2343091fed1569530"><td class="memItemLeft" align="right" valign="top">static QPointF&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_bezier.html#a962c356b89fb7fd2343091fed1569530">pointAt</a> (const QPointF &amp;p1, const QPointF &amp;cp1, const QPointF &amp;cp2, const QPointF &amp;p2, double t)</td></tr>
<tr class="separator:a962c356b89fb7fd2343091fed1569530"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An implementation of the de Casteljau’s Algorithm for interpolating Bézier curves. </p>
<p>The flatness criterion for terminating the subdivision is based on "Piecewise Linear Approximation of Bézier Curves" by Roger Willcocks ( <a href="http://www.rops.org">http://www.rops.org</a> )</p>
<p>This article explains the maths behind in a very nice way: <a href="https://jeremykun.com/2013/05/11/bezier-curves-and-picasso">https://jeremykun.com/2013/05/11/bezier-curves-and-picasso</a> </p>

<p class="definition">Definition at line <a class="el" href="qwt__bezier_8h_source.html#l00029">29</a> of file <a class="el" href="qwt__bezier_8h_source.html">qwt_bezier.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7b74d8e4874bc39110c84f74594d61b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b74d8e4874bc39110c84f74594d61b9">&#9670;&nbsp;</a></span>QwtBezier()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QwtBezier::QwtBezier </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>tolerance</em> = <code>0.5</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tolerance</td><td>Termination criterion for the subdivision </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_bezier.html#a5c0ad844ea7d4ee69f3c391fd1a93ae7">setTolerance()</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="qwt__bezier_8cpp_source.html#l00116">116</a> of file <a class="el" href="qwt__bezier_8cpp_source.html">qwt_bezier.cpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1e67390b7109a819d29b043418bcb1b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e67390b7109a819d29b043418bcb1b5">&#9670;&nbsp;</a></span>appendToPolygon()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QwtBezier::appendToPolygon </td>
          <td>(</td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>cp1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>cp2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>p2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QPolygonF &amp;&#160;</td>
          <td class="paramname"><em>polygon</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Interpolate a Bézier curve by a polygon. </p>
<p><a class="el" href="class_qwt_bezier.html#a1e67390b7109a819d29b043418bcb1b5" title="Interpolate a Bézier curve by a polygon.">appendToPolygon()</a> is tailored for cumulating points from a sequence of bezier curves like being created by a spline interpolation.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p1</td><td>Start point </td></tr>
    <tr><td class="paramname">cp1</td><td>First control point </td></tr>
    <tr><td class="paramname">cp2</td><td>Second control point </td></tr>
    <tr><td class="paramname">p2</td><td>End point </td></tr>
    <tr><td class="paramname">polygon</td><td>Polygon, where the interpolating points are added</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>If the last point of the incoming polygon matches p1 it won't be inserted a second time. </dd></dl>

<p class="definition">Definition at line <a class="el" href="qwt__bezier_8cpp_source.html#l00186">186</a> of file <a class="el" href="qwt__bezier_8cpp_source.html">qwt_bezier.cpp</a>.</p>

</div>
</div>
<a id="a962c356b89fb7fd2343091fed1569530"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a962c356b89fb7fd2343091fed1569530">&#9670;&nbsp;</a></span>pointAt()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QPointF QwtBezier::pointAt </td>
          <td>(</td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>cp1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>cp2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>p2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Find a point on a Bézier Curve</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p1</td><td>Start point </td></tr>
    <tr><td class="paramname">cp1</td><td>First control point </td></tr>
    <tr><td class="paramname">cp2</td><td>Second control point </td></tr>
    <tr><td class="paramname">p2</td><td>End point </td></tr>
    <tr><td class="paramname">t</td><td>Parameter value, something between [0,1]</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Point on the curve </dd></dl>

<p class="definition">Definition at line <a class="el" href="qwt__bezier_8cpp_source.html#l00239">239</a> of file <a class="el" href="qwt__bezier_8cpp_source.html">qwt_bezier.cpp</a>.</p>

</div>
</div>
<a id="a5c0ad844ea7d4ee69f3c391fd1a93ae7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c0ad844ea7d4ee69f3c391fd1a93ae7">&#9670;&nbsp;</a></span>setTolerance()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QwtBezier::setTolerance </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>tolerance</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the tolerance</p>
<p>The tolerance is a measurement for the flatness of a curve. A curve with a flatness below the tolerance is considered as being flat terminating the subdivision algorithm.</p>
<p>When interpolating a Bezier curve to render it as a sequence of lines to some sort of raster ( f.e to screen ) a value of 0.5 of the pixel size is a good value for the tolerance.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tolerance</td><td>Termination criterion for the subdivision </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_bezier.html#a53b980b7397ef4bdcbc011d6556108b8">tolerance()</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="qwt__bezier_8cpp_source.html#l00141">141</a> of file <a class="el" href="qwt__bezier_8cpp_source.html">qwt_bezier.cpp</a>.</p>

</div>
</div>
<a id="a53b980b7397ef4bdcbc011d6556108b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a53b980b7397ef4bdcbc011d6556108b8">&#9670;&nbsp;</a></span>tolerance()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double QwtBezier::tolerance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Tolerance, that is used as criterion for the subdivision </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_bezier.html#a5c0ad844ea7d4ee69f3c391fd1a93ae7">setTolerance()</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="qwt__bezier_8h_source.html#l00056">56</a> of file <a class="el" href="qwt__bezier_8h_source.html">qwt_bezier.h</a>.</p>

</div>
</div>
<a id="a1cac7efebcc8bf42fe9a12552a9d727d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1cac7efebcc8bf42fe9a12552a9d727d">&#9670;&nbsp;</a></span>toPolygon()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QPolygonF QwtBezier::toPolygon </td>
          <td>(</td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>cp1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>cp2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Interpolate a Bézier curve by a polygon. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p1</td><td>Start point </td></tr>
    <tr><td class="paramname">cp1</td><td>First control point </td></tr>
    <tr><td class="paramname">cp2</td><td>Second control point </td></tr>
    <tr><td class="paramname">p2</td><td>End point</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Interpolating polygon </dd></dl>

<p class="definition">Definition at line <a class="el" href="qwt__bezier_8cpp_source.html#l00157">157</a> of file <a class="el" href="qwt__bezier_8cpp_source.html">qwt_bezier.cpp</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_qwt_bezier.html">QwtBezier</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
